package com.example.smartmedicalsystem.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration
public class WebMvcConfig implements WebMvcConfigurer {

    @Override
    public void addResourceHandlers(ResourceHandlerRegistry registry) {
        // 新增全局静态资源映射
        registry.addResourceHandler("/**")
                .addResourceLocations("classpath:/static/");

        // 原有配置
        registry.addResourceHandler("/ai-assets/**")
                .addResourceLocations("classpath:/static/ai-assets/");

        registry.addResourceHandler("/medicine/**")
                .addResourceLocations("classpath:/static/medicine/");
    }
}